home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part1 / 2697 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.5 KB

  1. Path: EU.net!sun4nl!xs4all!usenet
  2. From: jtv@xs4all.nl (Jeroen T. Vermeulen)
  3. Newsgroups: comp.sys.amiga.misc
  4. Subject: Re: OS features
  5. Date: Tue, 23 Jan 96 01:16:15
  6. Organization: Leiden University, Mathematics & Computer Science, The Netherlands
  7. Message-ID: <19960123.7B89070.14DD@asd07-10.dial.xs4all.nl>
  8. References: <DLAA61.2us@inter.NL.net> <4dh2dm$jui@serpens.rhein.de> <1292.6592T166T2158@algonet.se> <4do01q$fmc@serpens.rhein.de> <19960120.7B57BE0.122A3@asd01-04.dial.xs4all.nl> <4dtg0e$1j7@serpens.rhein.de>
  9. NNTP-Posting-Host: asd07-10.dial.xs4all.nl
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-NewsSoftware: GRn 2.1 Feb 19, 1994
  14.  
  15.  
  16. In article <4dtg0e$1j7@serpens.rhein.de> mlelstv@serpens.rhein.de (Michael van Elst) writes:
  17.  
  18. [ Why keep PUBLIC pages locked in real mem? ]
  19.  
  20. > >I think it's because Forbid()/Permit() is still used in a lot of places where
  21. > >the OS should have defined a separate semaphore (and probably implemented
  22. > >deadlock detection and resolution as well).  So this memory is *more likely* to
  23. > >page-fault during Forbid().
  24. >
  25. > Actually the problem is that the flag MEMF_PUBLIC was never used for
  26. > anything and wasn't thought out well.
  27.  
  28. AFAIK it is commonly used (and used properly) by applications, and the
  29. distinction is relevant for VMM.  If the flag really doesn't matter, then this
  30. can't be the problem at all.
  31.  
  32. I just looked in the VMM docs (should have done that sooner), and they say that
  33. the problem is that stuff like I/O requests and the like mustn't be swapped out.
  34. What is probably meant is that deadlocks must be prevented, where memory is
  35. swapped out that needs to be present in real mem for the swap mechanism as a
  36. whole to work.  Of course the task list etc. must also be kept consistent during
  37. Forbid().
  38.  
  39.  
  40. > >[1] implement a special driver for the swap device as a single-threaded library,
  41. > >more or less like other OS's do (boo!), or
  42. >
  43. > Which can't be single-threaded because the disk driver can use arbitrary
  44. > tasks. That's no BIOS.
  45.  
  46. It would have to lock, of course.  With `single-threaded' I mean here that only
  47. one instance of the code could be active at any time (as if it were a task), but
  48. no actual context switch is made (as if it were a library).
  49.  
  50. Hey, I didn't say it was a *pretty* solution!
  51.  
  52.  
  53. > >[2] make a radical change:  Design around the problem for the new PPC OS so the
  54. > >problem is limited to the 68k emulator (compatibility vs VM/MP--past vs future!)
  55. >
  56. > The radical change is that software has to declare wether data has to
  57. > be locked in memory and it has to declare who will get access to the
  58. > data.
  59.  
  60. You mean separate flag bits for "swappable" and "sharable"?  AFAICS the only
  61. pools that had to be locked in memory would be:
  62.  
  63.  - Private memory allocated by the VM subsystem
  64.  - Global shared public mem (eg. public process list)
  65.  - Memory shared between any task and the VM subsystem + VM device driver
  66.  
  67. Am I missing another useful application?
  68.  
  69.  
  70. > Of course there will be unprotected memory, heuristics for old programs
  71. > (like the VMM database) and automatisms that let shared libraries handle
  72. > private data without special preparations.
  73.  
  74. Libraries aren't a problem in themselves, because they never leave the caller's
  75. context unless they're programmed to.  There is however the problem that you
  76. can't always tell who you're going to share your memory with (eg. when calling
  77. the dos.library functions).  This problem can be solved if all type information
  78. is known at the layer that passes the memory block on to the unexpected task.
  79.  
  80.  
  81. > >The easiest change would perhaps be, to have multiple public-memory pools for
  82. > >different groups of communicating processes,
  83.  
  84. > >each guarded by a semaphore, and
  85. > >change the meaning of the current Forbid() calls to "Obtain non-shared (write)
  86. > >access to all virtual public memory spaces accessible to me".
  87. >
  88. > This unfortunately does not work.
  89.  
  90. Why not?  As the set of "attempted" semaphores cannot change within a Forbid()
  91. section, the result is a trivial two-phase locking mechanism where no deadlocks
  92. can occur.  Of course the process list etc. would have to be virtualized so each
  93. process sees its own version which does not change in the meantime.  Most of the
  94. work could probably be deferred until a Forbid() call is actually made.
  95.  
  96. As all other memory is protected, I think this could work even in multiprocessor
  97. systems.  Of course it would hurt performance at first, but given a faster CPU
  98. to do this work (in native code) and an improved OS design it could be practical
  99. enough to allow existing applications a dignified retirement period.
  100.  
  101.  
  102. >                               But Forbid() isn't really useful
  103. > either in most situations. New programs really must use other
  104. > arbitration mechanisms. That's another reason why I want Forbid()
  105. > and Disable() to be trapped. A multiprocessor configuration will
  106. > then be the end of the "traditional" use of Forbid().
  107.  
  108. Of course, but it must be supported for existing software.  And with the scheme
  109. outlined above I think it can be, even in such multiprocessor configurations.
  110.  
  111.  
  112. >                                 Michael van Elst
  113. >
  114. > Internet: mlelstv@serpens.rhein.de
  115. >                                 "A potential Snark may lurk in every tree."
  116.  
  117. --
  118. ============================================================================
  119. #  Jeroen T. Vermeulen   \"How are we doing kid?"/   Yes, we use Amigas.   #
  120. #---  jtv@xs4all.nl    ---\"Oh, same as always."/--         ...          --#
  121. #jvermeul@wi.leidenuniv.nl \ "That bad, huh?"  /  Got a problem with that? #
  122.  
  123. MicroSoft.  Where Do You Want To Go Today?  ... We'll have you there in a decade
  124.